<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('添加养修服务项')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-customer-add">
            <input id="treeId" name="id" type="hidden"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项名称 ：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项原价 ：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="originalPrice" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项折扣价 ：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="discountPrice" required>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">是否套餐：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('si_car_package')}">
                        <input type="radio" th:id="${dict.dictCode}" name="carPackage" th:value="${dict.dictValue}" th:checked="${dict.isDefault}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">服务分类：</label>
                <div class="col-sm-8">
                    <select name="serviceCatalog" th:with="type=${@dict.getType('si_service_catalog')}" class="form-control" >
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">备注信息 ：</label>
                <div class="col-sm-8">
                    <textarea id="info" name="info" class="form-control"></textarea>
                </div>
            </div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
        var ctx = "http://localhost";
		var prefix = ctx + "/business/serviceItem";
	    
		// $("#form-customer-add").validate({
		// 	onkeyup: false,
		// 	rules:{
		// 		name:{
		// 			remote: {
		//                 url: prefix + "/checkCustomerNameUnique",
		//                 type: "customer",
		//                 dataType: "json",
		//                 data: {
		//                 	"name" : function() {
		//                         return $.common.trim($("#customerName").val());
		//                     }
		//                 },
		//                 dataFilter: function(data, type) {
		//                 	return $.validate.unique(data);
		//                 }
		//             }
		// 		},
		// 		code:{
		// 			remote: {
		//                 url: prefix + "/checkCustomerCodeUnique",
		//                 type: "customer",
		//                 dataType: "json",
		//                 data: {
		//                 	"code" : function() {
		//                         return $.common.trim($("#customerCode").val());
		//                     }
		//                 },
		//                 dataFilter: function(data, type) {
		//                 	return $.validate.unique(data);
		//                 }
		//             }
		// 		},
		// 		customerSort:{
		// 			digits:true
		// 		},
		// 	},
		// 	messages: {
		//         "code": {
		//             remote: "客户编码已经存在"
		//         },
		//         "name": {
		//             remote: "客户名称已经存在"
		//         }
		//     },
		//     focusCleanup: true
		// });
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/add", $('#form-customer-add').serialize());
	        }
	    }
	</script>
</body>
</html>
